package mathExpEvaluator.model.operator;

import mathExpEvaluator.model.Operator;
import mathExpEvaluator.model.exception.InvalidOperatorException;

public class OperatorFactory {
	
	public Operator createOperator(String symbol, int bc, int pos)throws InvalidOperatorException{
		if(symbol.equals("+"))
			return new AddOperator(bc, pos);
		if(symbol.equals("SIN"))
			return new SinOperator(bc, pos);
		if(symbol.equals("-"))
			return new SubstractOperator(bc, pos);
		if(symbol.equals("*"))
			return new MultiplyOperator(bc, pos);
		if(symbol.equals("/"))
			return new DivideOperator(bc, pos);
		throw new InvalidOperatorException();
	}

}
